let tips=document.getElementById("message");
let hidBaoming=document.getElementById("baoming");
let againbaoming=document.getElementById("againBaoming")
function sub(){
    let emailValue=document.getElementById("inputEmail").value;
    sure(school,year,emailValue);
}
//判断输入框内是否有值及邮箱格式是否正确
let sure=function(a,b,c){
    if(a===""){
        tips.innerHTML=`<span id="messageThen">请选择您就读或者毕业的学校。</span>`; 
        setTimeout(function(){tips.getElementsByTagName("span")[0].style.display="none"},3000)
    }else if(b===""){
        tips.innerHTML=`<span id="messageThen">请选择您的入学时间。</span>`;
        setTimeout(function(){tips.getElementsByTagName("span")[0].style.display="none"},3000)
    }else if(c==""){
        tips.innerHTML=`<span id="messageThen">您还没有输入邮箱。</span>`;
        setTimeout(function(){tips.getElementsByTagName("span")[0].style.display="none"},3000)    
    }else if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(c)){    
        tips.innerHTML=`<span id="messageThen">输入邮箱有误，请重新输入</span>`;
        setTimeout(function(){tips.getElementsByTagName("span")[0].style.display="none"},3000)
    }else{
        tips.innerHTML=`<span id="messageCatch">恭喜您,来自${a}${b}级${c}的同学,您的报名信息已记录,请关注您的邮箱。</span>`;
        setTimeout(function(){tips.getElementsByTagName("span")[0].style.display="none"},5000)
        hidBaoming.style.display="none";
        againbaoming.style.display="block";
    }
}
function again(){
    hidBaoming.style.display="block";
    againbaoming.style.display="none";
    // input_1.getElementsByTagName("input")[0].value="";
    // input.getElementsByTagName("input")[0].value="";
    // document.getElementById("inputEmail").value="";
}